home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / dodge.swf / scripts / __Packages / TrailManager.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.2 KB  |  46 lines

  1. class TrailManager extends MovieClipHolder
  2. {
  3.    var parent;
  4.    var target;
  5.    var trailNumber;
  6.    var color;
  7.    var mc;
  8.    function TrailManager(parent, target, trailNumber, color)
  9.    {
  10.       super(_root.createEmptyMovieClip("trail" + _root.getNextHighestDepth(),_root.getNextHighestDepth()),_root.effects < 3 ? null : color,false,true);
  11.       this.parent = parent;
  12.       this.target = target;
  13.       this.trailNumber = trailNumber;
  14.       this.color = color;
  15.       if(_root.effects >= 1)
  16.       {
  17.          this.mc.blendMode = "add";
  18.       }
  19.    }
  20.    function getCoords()
  21.    {
  22.       var _loc2_ = new flash.geom.Point(this.target._x,this.target._y);
  23.       this.parent.localToGlobal(_loc2_);
  24.       return _loc2_;
  25.    }
  26.    function makeTrail(rot)
  27.    {
  28.       var _loc2_ = this.mc.attachMovie("trail" + this.trailNumber,"trail" + this.mc.getNextHighestDepth(),this.mc.getNextHighestDepth());
  29.       var _loc3_ = this.getCoords();
  30.       _loc2_._x = _loc3_.x;
  31.       _loc2_._y = _loc3_.y;
  32.       if(rot != null)
  33.       {
  34.          _loc2_._rotation = rot;
  35.       }
  36.       else
  37.       {
  38.          _loc2_._rotation = Math.random() * 180;
  39.       }
  40.    }
  41.    function die()
  42.    {
  43.       this.mc.removeMovieClip();
  44.    }
  45. }
  46.